package fr.loof.fonzie.keywords;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author <a href="nicolas@apache.org">Nicolas De Loof</a>
 */
public enum Aggregate
{
    ALL
    {
        public String apply( String entity )
        {
            logger.trace( "apply 'all' aggregate" );
            return entity;
        }
    },
    COUNT
    {
        public String apply( String entity )
        {
            logger.trace( "apply 'count' aggregate" );
            return "count( " + entity + " )";
        }
    };

    private static Logger logger = LoggerFactory.getLogger( Aggregate.class );

    public abstract String apply( String entity );
}
